package com.aw.manual.ejemplo4;

import org.springframework.beans.factory.xml.XmlBeanDefinitionReader;
import org.springframework.context.support.GenericApplicationContext;
import org.springframework.core.io.ClassPathResource;

/**
 * User: gmc
 * Date: 21/04/2010
 */
public class EjemploInicializacion {

    public static void main(String[] args) {
        String configFiles = "com/aw/manual/ejemplo4/app-config.xml";
        GenericApplicationContext appCtx = new GenericApplicationContext();
        appCtx.getBeanFactory().registerSingleton("freno", new Freno());
        new XmlBeanDefinitionReader(appCtx).loadBeanDefinitions(new ClassPathResource(configFiles));
        appCtx.refresh();
        Carro carro = appCtx.getBean(Carro.class);
    }
}